﻿using System.Collections.Generic;
using KMF.Common;

namespace KMF.DAL
{
    public partial class ProductImageDb
    {
        public static List<ProductImageHasColorInfoDto> GetImageByColorId(string productId, string ColorId)
        {
            var dao = SharedSqlDao;
            var command = dao.GetDbSprocCommand("WSPX_ProductImage_GetByColorIdOnProductDetail");
            try
            {
                command.Parameters.Add(dao.CreateParameter("@ProductId", productId));
                command.Parameters.Add(dao.CreateParameter("@ColorId", ColorId));
                var result = dao.GetDTOList<ProductImageHasColorInfoDto>(ref command);
                return result;
            }
            finally
            {
                command.Connection.Close();
            }
        }
        
    }
}
